from django.contrib import admin
from .models import Store,GoodsInfo,Commodity_specification,Classification
from django.db import models
from django import forms
from django.utils.html import format_html
from django.core.files.base import ContentFile

# from qiniu import Auth,put_file, etag
from seaWind.settings import HOMEBANNER
import json
# Register your models here.




admin.site.site_header = '海风小店后台管理'
admin.site.site_title = '海风小店微信小程序后台管理'  # 此处设置页面头部标题


show = '<span style="font-size:larger;font-weight:bolder;background:#ddffdd;color:black"></span>'

@admin.register(Store)
class Store_admin(admin.ModelAdmin,object):
    """
    store_configiratioin_ID
    home_page_banner            : 首页轮播图
    announcement                : 公告列表
    show_home_page_banner       : 是否显示首页轮播图
    show_announcement           : 是否显示公告
    show_classification_icon    : 是否显示分类小图标
    show_classification_banner  : 是否显示分类横幅
    """

    # home_page_bannerFunc.short_description = "首页轮播图"
    fields = ["home_page_banner","home_page_banner2","home_page_banner3","home_page_banner4"]


@admin.register(GoodsInfo)
class GoodsInfo_admin(admin.ModelAdmin):
    list_display = ["GoodsInfo_ID", "category_ID", "name"]



@admin.register(Commodity_specification)
class Specification_admin(admin.ModelAdmin):
    pass

@admin.register(Classification)
class Classification_admin(admin.ModelAdmin):
    fields = ["name"]

    pass
